# 适用配置中心的配置
import os
from pyapollo.apollo_client import ApolloClient

conf = ApolloClient(
    app_id=os.getenv("CONFIG_API_ID"), config_server_url=os.getenv("CONFIG_SERVER_URL")
)

RABBITMQ_USER = conf.get_value("RABBITMQ_USER")
RABBITMQ_PASS = conf.get_value("RABBITMQ_PASS")
RABBITMQ_HOST = conf.get_value("RABBITMQ_HOST")
RABBITMQ_PORT = int(conf.get_value("RABBITMQ_PORT"))


REDIS_HOST = conf.get_value("REDIS_HOST")
REDIS_PASSWORD = conf.get_value("REDIS_PASSWORD")
REDIS_PORT = int(conf.get_value("REDIS_PORT"))


MYSQL_HOST = conf.get_value("MYSQL_HOST")
MYSQL_PORT = conf.get_value("MYSQL_PORT")
MYSQL_USER = conf.get_value("MYSQL_USER")
MYSQL_PASSWORD = conf.get_value("MYSQL_PASSWORD")

MONGO_USERNAME = conf.get_value("MONGO_USERNAME")
MONGO_PASSWORD = conf.get_value("MONGO_PASSWORD")
MONGO_HOST = conf.get_value("MONGO_HOST")
MONGO_PORT = int(conf.get_value("MONGO_PORT"))

qanything_api_local_doc_chat = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_LOCAL_DOC_CHAT')}"
qanything_api_list_knowledge_base = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_LIST_KNOWLEDGE_BASE')}"
qanything_api_get_bot_info = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_GET_BOT_INFO')}"
qanything_api_new_knowledge_base = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_NEW_KNOWLEDGE_BASE')}"
qanything_api_new_bot = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_NEW_BOT')}"
qanything_api_upload_files = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_UPLOAD_FILES')}"
qanything_api_list_files = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_LIST_FILES')}"
qanything_api_new_bot = f"http://{conf.get_value('QANYTHING_HOST')}:{conf.get_value('QANYTHING_PORT')}{conf.get_value('QANYTHING_NEW_BOT')}"
qanything_headers = eval(conf.get_value("QANYTHING_HEADES"))


openai_api_key = conf.get_value("OPENAI_AIP_KEY")
openai_base_url = conf.get_value("OPENAI_BASE_URL")
